package com.lifeng.shop.lifengshop.servies.impl;

import com.lifeng.shop.lifengshop.mapper.BrandMapper;
import com.lifeng.shop.lifengshop.mapper.CategoryMapper;
import com.lifeng.shop.lifengshop.mapper.ProductMapper;
import com.lifeng.shop.lifengshop.pojo.bo.ParentProduct;
import com.lifeng.shop.lifengshop.pojo.entry.Category;
import com.lifeng.shop.lifengshop.pojo.entry.Product;
import com.lifeng.shop.lifengshop.servies.SearchServies;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Fusion
 * @Date:2021/8/10 15:18
 **/
@Service
public class SearchServiesImpl implements SearchServies {

    @Autowired
    ProductMapper productMapper;
    @Autowired
    BrandMapper brandMapper;
    @Autowired
    CategoryMapper categoryMapper;


    @Override
    public List<ParentProduct> selectAllShop(Integer tid) {
        return productMapper.selectAllShop(tid);
    }

    @Override
    public Category selectLikeConcatByTypeName(String typeName) {
        return categoryMapper.selectLikeConcatByTypeName(typeName);
    }

    @Override
    public List<Product> selectAllBygname(String name) {
        return productMapper.selectAllBygname(name);
    }
}
